package com.example.jimanguang.Entity;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Entity
@Table(name = "appliction")
@Getter
@Setter
public class Appliction extends BaseEntity{
    @Transient
    public static final int STATUS_APPLYING=0;//申请中
    @Transient
    public static final int  STATUS_PASS=1;//通过
    @Transient
    public static final int STATUS_REFUSE=2;//拒绝
    private int status;//申请状态

    @Temporal(TemporalType.TIMESTAMP)
    private Date applyTime;//申请时间

    public Appliction(){
        applyTime=new Date();
    }


    @ManyToOne
    private User creator;

    @OneToOne
    private Comics comics;

   @JsonBackReference
   public User getCreator(){return creator;}

}
